package javaBase.nowcoder.HJ40_A_统计字符;

import java.io.*;

public class Main {
    public static void main(String args[]) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        int w = 0;
        int d = 0;
        int t = 0;
        int o = 0;
        for (int i = 0; i < str.length(); i++) {
            if ('a' <= str.charAt(i) && str.charAt(i) <= 'z') {
                w++;
            }
            if ('0' <= str.charAt(i) && str.charAt(i) <= '9') {
                d++;
            }
            if (str.charAt(i) == ' ') {
                t++;
            }
        }
        o = str.length() - w - t - d;
        System.out.println(w);
        System.out.println(t);
        System.out.println(d);
        System.out.println(o);
    }

}